﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Perovich.GameObjects.Components;

namespace Perovich.GameObjects.Entities
{
    public interface IEntityCollection : ICollection<IEntity>
    {
        IEntity Find(string name);
        IEntity FindWith<T>() where T : IEntityComponent;
        IEnumerable<IEntity> FindAllWith<T>() where T : IEntityComponent;

        T Find<T>(string name) where T : IEntityComponent;

        bool Remove(string name);
        bool RemoveImmediate(string name);
        bool RemoveImmediate(IEntity entity);
        bool Remove(IEntityComponent component);
        bool RemoveImmediate(IEntityComponent component, bool updateDependencies);

        event EventHandler<EntityEventArgs> EntityAdded;
        event EventHandler<EntityEventArgs> EntityRemoved;
    }
}
